package cn.fanyamin.web.service;

import java.util.List;

import cn.fanyamin.domain.Book;
import cn.fanyamin.web.dao.BookDao;
import cn.fanyamin.web.dao.BookNoDbDao;

public class BookServiceImpl implements BookService {
    private BookDao dao;

    public BookServiceImpl() {
        this.dao = new BookNoDbDao();
    }

    public List<Book> getBooks() {
        return this.dao.getBooks();
    }

    public void updateBook(Book book) {
        this.dao.update(book);
    }

    public void deleteBook(Integer id) {
        this.dao.delete(id);

    }

    @Override
    public Book getBook(Integer id) {
        return this.dao.getBook(id);
    }

    @Override
    public void insertBook(Book book) {
        this.dao.insert(book);
    }

}
